﻿<div ng-controller="IndirectsponsorController">
    <div class="row">
        <div class="col-lg-12 col-sm-12 col-xs-12">
            <div class="row">
                <div class="col-lg-8 col-sm-8 col-xs-8">

                    <div class="well with-header">
                        <div class="header bg-blue">
                            Community System Tree
                        </div>
                        <div class="body">
                            <div class="pull-right">
                                <button class="btn btn-sm" ng-click="ToAssign(downline)" ng-disabled="!downline.downlineId>0">
                                    <i class="fa fa-user"></i> Open Account <span ng-if="downline.downlineId>0">{{downline.UserName}}</span>
                                </button>
                            </div>
                            <div id="tree" ng-click="doLoadTree()"></div>
                            <div id="entrytree" ng-show="nottree">Not loadding Data Tree</div>
                            <div class="clearfix"></div>
                            <div class="note" style="margin-top:15px;">
                                <ul id="note" class="list-inline">
                                    <li><span class="active" style="display:inline-block;width:20px;height:10px;background-color:#5bc0de;"></span> Active</li>
                                    <li><span class="unactive" style="display:inline-block;width:20px;height:10px;background-color:#999999;"></span> UnActive</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4 col-sm-4 col-xs-4">
                    <div class="well with-header">
                        <div class="header bg-blue">
                            Account Info                            
                        </div>
                        <div class="body">
                            <ul class="list-unstyled">
                                <li><h5><i class="fa fa-user"></i> UserName: {{downline.UserName}}</h5></li>
                                <li><h5><i class="fa fa-info-circle"></i> FullName: {{downline.HoTen}}</h5></li>
                                <li><h5><i class="fa fa fa-users"></i> Total F1: {{downline.TotalF1}}</h5></li>
                                <li><h5><i class="fa fa fa-globe"></i> Invest: {{downline.Invest}}</h5></li>
                                <li><h5><i class="fa fa-info-circle"></i> Downline: {{downline.Total}}</h5></li>
                                <li><h5><i class="fa fa-info-circle"></i> Total Pin: {{downline.TotalPin}}</h5></li>   
                            </ul>
                        </div>
                    </div>
                </div>

            </div>

            <div class="row" ng-if="ShowAssignForm">
                <div class="col-lg-12 col-sm-12 col-xs-12">
                    <div class="well with-header">
                        <div class="header bg-blue">
                            Open Account
                        </div>
                        <div class="body">

                            <div class="row">
                                <div class="col-lg-6 col-sm-6 col-xs-12 col-md-offset-3">
                                    <form name="simpleForm" method="post" class="form-horizontal bv-form" novalidate="novalidate">

                                        <alert type="{{AlertType}}" class="radius-bordered alert-shadowed" ng-if="messeger">
                                            {{messeger}}
                                        </alert>

                                        <div class="form-group" ng-class="{ 'has-error' : simpleForm.required.$invalid && !simpleForm.required.$pristine }">
                                            <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Sponsor2</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control" placeholder="Sponsor 2" ng-model="UserAssign.Sponsor2" readonly />
                                                <p ng-show="simpleForm.UserAssign.Sponsor2.$invalid && !simpleForm.UserAssign.Sponsor2.$pristine" class="help-block">This field is required.</p>
                                            </div>
                                        </div>

                                        <div class="form-group" ng-class="{ 'has-error' : simpleForm.required.$invalid && !simpleForm.required.$pristine }">
                                            <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Username</label>
                                            <div class="col-sm-8">
                                                <input type="text" class="form-control" placeholder="Username" ng-model="UserAssign.UserName" required />
                                                <p ng-show="simpleForm.UserAssign.UserName.$invalid && !simpleForm.UserAssign.UserName.$pristine" class="help-block">This field is required.</p>
                                            </div>
                                        </div>

                                        <div class="form-group" ng-class="{ 'has-error' : simpleForm.required.$invalid && !simpleForm.required.$pristine }">
                                            <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Password</label>
                                            <div class="col-sm-8">
                                                <input type="password" class="form-control" placeholder="Password" ng-model="UserAssign.Password" required />
                                            </div>
                                        </div>

                                        <div class="form-group" ng-class="{ 'has-error' : simpleForm.required.$invalid && !simpleForm.required.$pristine }">
                                            <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Password</label>
                                            <div class="col-sm-8">
                                                <input type="password" class="form-control" placeholder="Password2" ng-model="UserAssign.Password2" required />
                                            </div>
                                        </div>

                                        <div class="form-group" ng-class="{ 'has-error' : simpleForm.Email.$invalid && !simpleForm.Email.$pristine }">
                                            <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Email</label>
                                            <div class="col-sm-8">
                                                <input type="email" class="form-control" placeholder="Email" ng-model="UserAssign.Email" required />
                                                <p ng-show="simpleForm.email.$invalid && !simpleForm.email.$pristine" class="help-block">This field must be a valid Email Address</p>
                                            </div>
                                        </div>

                                        <div class="form-group" ng-class="{ 'has-error' : simpleForm.tel.$invalid && !simpleForm.tel.$pristine }">
                                            <label for="inputEmail3" class="col-sm-3 control-label no-padding-right">Phone</label>
                                            <div class="col-sm-8">
                                                <input type="tel" class="form-control" placeholder="Phone" ng-model="UserAssign.SDTNHARIENG" required />
                                                <p ng-show="simpleForm.tel.$invalid && !simpleForm.tel.$pristine" class="help-block">This field must be a valid Email Address</p>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <div class="col-sm-8 col-sm-offset-3">
                                                <button class="btn btn-primary" ng-click="SaveAssignUser(UserAssign)" ng-disabled="progress">
                                                    Save User
                                                </button>
                                                <span ng-show="progress" class="text-success"><i class="fa fa-circle-o-notch fa-spin"></i></span>
                                            </div>
                                        </div>


                                    </form>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
